<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/vue.js"></script>

</head>

<body>
    <div id="root">
        <h1>{{name}}</h1>
    </div>

    <script type="text/javascript">
        let number = 18
        let person = {
            name: '张三',
            sex: '男',
        }

        const as = Object.defineProperty(person, 'age', {
            // value: 18,
            // enumerable: true,
            // writable: true,
            // configurable: true ,
            get(){
                console.log("调用get")
                return number
            },
            set(value){
                console.log("调用set")
                number = value
            }
        })
        console.log(person)
        // console.log(as)
        // console.log(Object.keys(person))
        // console.log(Object.values(person))
        for (let keyas in person) {
            console.log(person[keyas])
        }
        // new Vue({
        //     el: "#root",
        //     data() {
        //         return {
        //             name: "你好"
        //         }
        //     }
        // })
    </script>

</body>

</html>